package njupt.tree;


import njupt.printer.BinaryTrees;

public class Test {

    public static void main(String[] args) {
        BST<Integer> tree=new RBTree<>(new BST.Comparator<Integer>() {
            @Override
            public int compare(Integer e1, Integer e2) {
                return e1-e2;
            }
        });
        int[] arr=new int[]{55,23,77,22,53,66,100,11,44,88,101};
        for(int i=0;i<arr.length;i++){
            System.out.println("---------------------add"+arr[i]);
            tree.add(arr[i]);
            BinaryTrees.println(tree);
            System.out.println("-----------------------");
        }
        for(int i=0;i<arr.length;i++){
            System.out.println("---------------------sub"+arr[i]);
            tree.remove(arr[i]);
            BinaryTrees.println(tree);
            System.out.println("-----------------------");
        }

//        tree.inOrderTraversal(tree.root);
    }
}
